Skip to content

refactor(options)!: simplify Options to transaction behavior and encryption - #38

Merged
emma31-dev merged 6 commits into
mainfrom
cleanup/27-audit-experimental-options
Nov 24, 2026
Merged

emma31-dev merged 6 commits into
mainfrom
cleanup/27-audit-experimental-options

Conversation

@emma31-dev

@emma31-dev emma31-dev commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Implements #27 by reducing Options to the settings the crate acts on directly, and adds a configurable busy timeout.

Added

  • Options::with_busy_timeout sets how long a connection waits for a contended database lock before returning Busy. The default remains five seconds, and Duration::ZERO fails immediately on contention. The timeout applies to local stores and to the local cache of remote sync stores.

Removed

  • Pass-through engine builders that only affected application SQL: with_index_method, with_vacuum, with_attach, with_generated_columns, and with_without_rowid.
  • Engine-tuning builders whose flags can be derived from the transaction behavior: with_multiprocess_wal and with_mvcc_passive_checkpoint.
  • The Error::ConflictingOptions variant, which only reported combinations of the removed builders.

Applications that need the removed SQL capabilities can open their own Turso database or run the corresponding SQL.

Automatic engine flags

  • TransactionBehavior::Concurrent enables MVCC passive checkpointing and switches local databases to MVCC journal mode.
  • Deferred, Immediate, and Exclusive enable Turso's multi-process WAL coordinator for file-backed local databases.
  • In-memory databases do not enable multi-process WAL, which Turso rejects.
  • Remote stores always enable multi-process WAL for the local sync cache; Concurrent remains unsupported.

Documentation

  • README and rustdoc describe only the transaction-behavior option and the engine flags it implies.
  • The README transaction-options table now gives Deferred, Immediate, Exclusive, and Concurrent their own rows, including when to use each and the engine flags it enables.
  • The benchmark no longer needs a turso.multiprocess_wal setting.
  • The crate version is unchanged in this PR; release versioning is handled separately.

Testing

  • cargo fmt --all -- --check
  • cargo test --all-targets --locked
  • cargo test --all-targets --all-features --locked
  • cargo check --no-default-features --locked
  • cargo test --doc --all-features --locked
  • cargo clippy --tests --all-features --locked -- -D warnings
  • RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps --locked
  • cargo package --list --locked --allow-dirty

cargo clippy --all-targets still reports three pre-existing lints in benches/backends.rs, unrelated to this change and not run by CI.

Closes #27.

Remove with_index_method, with_vacuum, with_attach,
with_generated_columns, and with_without_rowid. They only enabled
application SQL and did not affect the crate's schema or queries.

Require TransactionBehavior::Concurrent for
with_mvcc_passive_checkpoint so it fails when MVCC is off instead of
silently doing nothing.

Bump to 0.4.0 for the breaking API change.

Refs #27
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

Remove with_multiprocess_wal and with_mvcc_passive_checkpoint from the
public API, leaving transaction behavior, encryption, and remote sync
settings. MVCC passive checkpointing is enabled automatically for
Concurrent, while the other behaviors enable multi-process WAL for
file-backed local databases. Remote stores always use multi-process WAL.

Drop the now-unused Error::ConflictingOptions variant and the
turso.multiprocess_wal benchmark setting.

Refs #27
@emma31-dev emma31-dev changed the title refactor(options)!: drop pass-through Turso engine flags refactor(options)!: simplify Options to transaction behavior and encryption Nov 20, 2026
@emma31-dev
emma31-dev force-pushed the cleanup/27-audit-experimental-options branch from b565e83 to aa8095e Compare November 24, 2026 22:51
@emma31-dev
emma31-dev merged commit 9311162 into main Nov 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Cleanup]: Audit experimental options and remove ones that do not affect bdk_turso

1 participant